package com.briup.cloud.framework.resource.web.rest;

import com.briup.framework.utils.web.Response;
import com.briup.framework.utils.web.SecurityUserDetails;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.stereotype.Component;

import java.security.Principal;
import java.util.Map;

/**
 * @Author guomiao
 * @Date 2022/3/22 13:49
 */
//@Component
public class RemoteServiceHystrix implements RemoteService{
    @Override
    public ResponseEntity<OAuth2AccessToken> postAccessToken(Principal principal, Map<String, String> parameters) {
        HttpHeaders map = new HttpHeaders();
        map.add("msg","用户名或密码错误！");
        ResponseEntity<OAuth2AccessToken> resp = new ResponseEntity<>(map,HttpStatus.BAD_REQUEST);
        return resp;
    }

    @Override
    public Response<SecurityUserDetails> hello() {
        System.out.println("服务熔断。。。。");
        return null;
    }
}
